/*
 * @Author: 高瑞寒 15932717091@163.com
 * @Date: 2022-04-27 18:06:12
 * @LastEditTime: 2022-04-28 11:01:21
 * @LastEditors: 高瑞寒 15932717091@163.com
 * @Description: 
 */
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import Item from './components/Item'
import './index.css'

export default class List extends Component {
  static propTypes = {
    onDelete: PropTypes.func.isRequired
  }

  render() {
    return (
      <ul className="todo-main">
        {this.props.data.map(item => <Item onDelete={this.props.onDelete} key={item.id} {...item} onFinish={this.props.onFinish} />
        )}
      </ul>
    )
  }
}